<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
<h:head>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
</h:head>

<!-- <ui:param name="bean" value="#{biMonitorResultAction}" /> -->
<h:body>
	<span class="pagetitle">告警管理—— 告警结果查询</span>
	<p:separator />
	<!-- 页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:poll interval="30" listener="#{biMonitorResultAction.searchByCriteria()}" update="dlist" />
	
		<p:calendar value="#{biMonitorResultAction.dateStart}" mode="popup"
			pattern="yyyy-MM-dd HH:mm:ss" />
		-
		<p:calendar value="#{biMonitorResultAction.dateEnd}" mode="popup"
			pattern="yyyy-MM-dd HH:mm:ss" />
		&#160;&#160;&#160;
		 <p:commandButton value="查询"
			action="#{biMonitorResultAction.searchByCriteria()}" update="dlist" />
		<br />
		<br />
		<div class="data" id="data">
			<p:panel id="panel1" header="告警记录" style="margin-bottom:10px;">
				<p:dataTable id="dlist" var="l"
					value="#{biMonitorResultAction.list}" resizableColumns="true"
					paginator="true" paginatorPosition="top" scrollable="true"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}"
					rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					
					<f:facet name="{Exporters}">
						<h:commandLink  styleClass="exporter">
					        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
					        <p:dataExporter type="xls" target="dlist" fileName="monitorResult-#{pageHelper.getNewDateDetailStr()}"/>
					    </h:commandLink>
					</f:facet>

					<p:column sortBy="#{l.jobId}" headerText="监控条件说明" styleClass="column" style="width:400px">
						<h:outputText value="#{biMonitorResultAction.getDescription(l.jobId)}" styleClass="fullwidth" />
					</p:column>
					<p:column sortBy="#{l.serverId}" headerText="服务器名称" styleClass="column">
						<h:outputText value="#{pageHelper.getServerNameById(l.serverId)}" styleClass="fullwidth" />
					</p:column>
					<p:column headerText="监控对象类型" styleClass="column">
						<h:outputText value="#{biMonitorResultAction.getSubDescription(l.jobId)}" styleClass="fullwidth" />
					</p:column>
					<p:column sortBy="#{l.userOrGroupName}" headerText="监控对象" styleClass="column">
						<h:outputText value="#{l.userOrGroupName}" styleClass="fullwidth" />
					</p:column>
					<p:column headerText="告警值" styleClass="column">
						<h:outputText value="#{l.result}" styleClass="fullwidth" />
					</p:column>
					<p:column sortBy="#{l.creatTime}" headerText="告警时间" styleClass="column">
						<h:outputText
							value="#{biMonitorResultAction.dateConvertion(l.creatTime)}"
							styleClass="fullwidth" />
					</p:column>

				</p:dataTable>
			</p:panel>
		</div>
	</h:form>
</h:body>
</html>
